package com.pojo;

import com.auto.annotation.AutoCode;
import com.auto.annotation.Column;
import com.auto.annotation.MyFunction;
import com.auto.annotation.Table;
import com.common.CommonUtil;
import com.common.ZjmUtil;

/**
 * EG
 * 预算项目字典
 *
 * @author
 */
//@AutoCode(isOverride = true, includeSupperClass = false, showWay = "tree")
//@Table(name = "budget_xm@year", jsname = "预算项目字典", includeSupperClass = false)
//@MyFunction(autoInitFromAccess = true, copyLastYearData = true, treeSort = false)
public class BudgetInfo extends TreeNodeBean {
	/**
	 *
	 */
	private static final long serialVersionUID = -9011777967101276026L;
	@Column(flag = "primary", treeId = true, autoGenneral = true)
	private String pid;
	@Column
	private String companyid;
	@Column(treecolumn = true, jsname = "预算编号", jswidth = 150, jsAllowBlank = false, jsValidator = true, keyWordFilte = true)
	private String procode;
	@Column(jsname = "预算项目名称", jsAllowBlank = false, jswidth = 150, keyWordFilte = true)
	private String proname;
	@Column(keyWordFilte = true)
	private String zjm;
	@Column(jsname = "项目类型", render = "function(v){if(v=='1'){return '支出类型';}else {return '收入类型';}}",
			jsxtype = "radiogroup [items:[{"
					+ "inputValue: '1',"
					+ "boxLabel: '支出类型',"
					+ "anchor  : '60%',"
					+ "name  : 'protype',"
					+ "checked: true"
					+ "}, {"
					+ "inputValue: '-1',"
					+ "anchor  : '60%',"
					+ "name  : 'protype',"
					+ "boxLabel: '收入类型'"
					+ "}]]")
	private String protype;// 1 支出类型   -1 收入类型
	@Column(treeparentId = true)
	private String parentid;
	@Column(treeleaf = true)
	private int isleaf;
	@Column
	private int isstop;// 0启用,1停用

	//===========================GETTERS && SETTERS=============================//
	public String getProcode() {
		return procode;
	}

	public void setProcode(String procode) {
		this.procode = procode;
	}

	public String getProname() {
		return proname;
	}

	public void setProname(String proname) {
		this.proname = proname;
	}

	public String getZjm() {
		if (CommonUtil.isEmpty(this.getProname())) {
			return null;
		} else {
			return ZjmUtil.generateZJM(this.getProname());
		}
	}

	public void setZjm(String zjm) {
		this.zjm = zjm;
	}

	public String getProtype() {
		return protype;
	}

	public void setProtype(String protype) {
		this.protype = protype;
	}

	public String getParentid() {
		return parentid;
	}

	public void setParentid(String parentid) {
		this.parentid = parentid;
	}

	public int getIsleaf() {
		return isleaf;
	}

	public void setIsleaf(int i) {
		this.isleaf = i;
	}

	public int getIsstop() {
		return isstop;
	}

	public void setIsstop(int isstop) {
		this.isstop = isstop;
	}

	public String getCompanyid() {
		return this.companyid;
	}

	public void setCompanyid(String companyid) {
		this.companyid = companyid;
	}

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

}
